Definicion de variables para calcular el Kp que varia sobre la oblea
In [1]:
from IPython.core.display import Image, display
display(Image(url='images/TipicalValuesLongChannel.png'))
Variacion por cuadro de Kp del 0.0004%
In [2]:
%matplotlib inline
import math
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import pylab as plb
def matrix(m_length,m_width):
"Return matrix with no homogeneus resitivity"
m = np.zeros((m_length,m_width))
return m
Material_length=963e-6
scmos_process = 3.e-6
wafer_thickness = 0.05e-6
KP_n_base = 120e-6
KP_p_base = 40e-6
size_m = Material_length/scmos_process
delta_KP=0.05e-6
plt.style.use('ggplot')
Matriz de Trasconductancia ideal KP_n_Ideal
In [3]:
KP_n_Ideal = matrix(int(size_m),int(size_m))
for i in range(0,int(math.sqrt(KP_n_Ideal.size))):
for j in range(0,int(math.sqrt(KP_n_Ideal.size))):
KP_n_Ideal[i][j]= KP_n_base
plt.matshow(KP_n_Ideal)
plt.show()
Matriz de Trasconductancia ideal KP_p_Ideal
In [4]:
KP_p_Ideal = matrix(int(size_m),int(size_m))
for i in range(0,int(math.sqrt(KP_p_Ideal.size))):
for j in range(0,int(math.sqrt(KP_p_Ideal.size))):
KP_p_Ideal[i][j]= KP_p_base
plt.matshow(KP_p_Ideal)
plt.show()
OPCION 1 Creacion de las matrices del material con variaciones en Kp_n y Kp_p a partir de la esquina
In [5]:
Kp_n = matrix(int(size_m),int(size_m))
def corner_kp_n():
for i in range(0,int(math.sqrt(Kp_n.size))):
for j in range(0,int(math.sqrt(Kp_n.size))):
Kp_n[i][j]= KP_n_base+(i+j)*delta_KP
corner_kp_n()
plt.matshow(Kp_n)
plt.show()
In [6]:
Kp_p = matrix(int(size_m),int(size_m))
def corner_kp_p():
for i in range(0,int(math.sqrt(Kp_p.size))):
for j in range(0,int(math.sqrt(Kp_p.size))):
Kp_p[i][j]= KP_p_base+(i+j)*delta_KP
corner_kp_p()
plt.matshow(Kp_p)
plt.show()
OPCION 2 Creacion de las matrices del material con variaciones en Kp_n y Kp_p del centro hacia afuera
In [7]:
Kp_n = matrix(int(size_m),int(size_m))
def centroid_KP_n(center,i,j):
"Return a value of KP_n for a single shape"
difJ=abs(center-j)
difI=abs(center-i)
xy=0
if difJ > difI:
xy=difJ
else:
xy=difI
Kpn= KP_n_base+(xy)*delta_KP
return Kpn
def center_kp_n():
for i in range(0,int(math.sqrt(Kp_n.size))):
for j in range(0,int(math.sqrt(Kp_n.size))):
Kp_n[i][j]= centroid_KP_n((int(math.sqrt(Kp_n.size))-1)/2,i,j)
center_kp_n()
plt.matshow(Kp_n)
plt.show()
In [8]:
Kp_p = matrix(int(size_m),int(size_m))
def centroid_KP_p(center,i,j):
"Return a value of KP_n for a single shape"
difJ=abs(center-j)
difI=abs(center-i)
xy=0
if difJ > difI:
xy=difJ
else:
xy=difI
Kpp= KP_p_base+(xy)*delta_KP
return Kpp
def center_kp_p():
for i in range(0,int(math.sqrt(Kp_p.size))):
for j in range(0,int(math.sqrt(Kp_p.size))):
Kp_p[i][j]= centroid_KP_p((int(math.sqrt(Kp_p.size))-1)/2,i,j)
center_kp_p()
plt.matshow(Kp_p)
plt.show()
Inicializando la matriz de dibujo en el material
In [9]:
paint_matrix = matrix(int(size_m),int(size_m))
plt.matshow(paint_matrix)
plt.show()
Ingrese las dimensiones LxW de los transistores
In [10]:
display(Image(url='images/WLCMOS.png'))
In [11]:
W_base=2
WTA=60
WTB=60
WTC=60
WTD=60
lenght_active_si_transistor = 6
L=2
OPCION 1 de Diseño de 4 transistores de optimizacion de espacio con centroide comun en la oblea, para usar 2 de esos en la simulacion del espejo de corriente
In [12]:
display(Image(url='images/Transistor.png'))
print("Diseno para ahorro de espacio en el transistor, W_base de 2 unidades")
In [13]:
paint_matrix = matrix(int(size_m),int(size_m))
common_source=9
def opcion1():
M_center=int((int(math.sqrt(paint_matrix.size))-1)/2)
TA = matrix(W_base,int((WTA/W_base+1)*(lenght_active_si_transistor/2)))
for i in range(M_center-2-TA.shape[0],M_center-2):
for j in range(M_center-2-TA.shape[1],M_center-2):
paint_matrix[i][j]=1
TB = matrix(W_base,int((WTB/W_base+1)*(lenght_active_si_transistor/2)))
for i in range(M_center-2-TB.shape[0],M_center-2):
for j in range(M_center+3,TB.shape[1]+M_center+3):
paint_matrix[i][j]=2
TC = matrix(W_base,int((WTC/W_base+1)*(lenght_active_si_transistor/2)))
for i in range(M_center+3,TC.shape[0]+M_center+3):
for j in range(M_center-2-TC.shape[1],M_center-2):
paint_matrix[i][j]=3
TD = matrix(W_base,int((WTD/W_base+1)*(lenght_active_si_transistor/2)))
for i in range(M_center+3,TD.shape[0]+M_center+3):
for j in range(M_center+3,TD.shape[1]+M_center+3):
paint_matrix[i][j]=4
opcion1()
plt.matshow(paint_matrix)
plt.show()
OPCION 2, Diseño de 2 transistores de centroide comun con source compartido (ver imagen). Diseno sugerido de diferentes articulos:
[1] http://class.ece.iastate.edu/vlsi2/docs/Papers%20Done/1999-08-MWSCAS-ML.pdf
[2] http://www.wseas.us/e-library/conferences/2005venice/papers/508-397.pdf
In [14]:
display(Image(url='images/currentmirrorlayout.png'))
print("Diseno propuesto para layout del espejo de corriente")
In [15]:
paint_matrix = matrix(int(size_m),int(size_m))
common_source=9
def opcion2():
M_center=int((int(math.sqrt(paint_matrix.size))-1)/2)
Trasistor_branch_per_side=1
shape_sides=4
Transistor_branches=Trasistor_branch_per_side*shape_sides
branch_W=int(WTA/Transistor_branches)
TSource=matrix(int(2*branch_W+(lenght_active_si_transistor/2)*3),int(2*branch_W+(lenght_active_si_transistor/2)*3))
for i in range(M_center-int(TSource.shape[0]/2),M_center+int(TSource.shape[0]/2)):
for j in range(M_center-int(TSource.shape[0]/2),M_center+int(TSource.shape[0]/2)):
paint_matrix[i][j]=common_source
TA_1 = matrix(branch_W,int(lenght_active_si_transistor))
for i in range(M_center-2-TA_1.shape[0],M_center-2):
for j in range(M_center-TA_1.shape[1]-int(TSource.shape[0]/2),M_center-int(TSource.shape[0]/2)):
paint_matrix[i][j]=4
TA_2 = matrix(branch_W,int(lenght_active_si_transistor))
for i in range(M_center+3,TA_2.shape[0]+M_center+3):
for j in range(M_center+int(TSource.shape[0]/2)-1,TA_2.shape[1]+M_center+int(TSource.shape[0]/2)-1):
paint_matrix[i][j]=4
TA_3 = matrix(branch_W,int(lenght_active_si_transistor))
for i in range(M_center-TA_3.shape[1]-int(TSource.shape[0]/2),M_center-int(TSource.shape[0]/2)):
for j in range(M_center+3,TA_3.shape[0]+M_center+3):
paint_matrix[i][j]=4
TA_4 = matrix(branch_W,int(lenght_active_si_transistor))
for i in range(M_center+int(TSource.shape[0]/2)-1,TA_4.shape[1]+M_center+int(TSource.shape[0]/2)-1):
for j in range(M_center-2-TA_4.shape[0],M_center-2):
paint_matrix[i][j]=4
TB_1 = matrix(branch_W,int(lenght_active_si_transistor))
for i in range(M_center+3,TB_1.shape[0]+M_center+3):
for j in range(M_center-TB_1.shape[1]-int(TSource.shape[0]/2),M_center-int(TSource.shape[0]/2)):
paint_matrix[i][j]=5
TB_2 = matrix(branch_W,int(lenght_active_si_transistor))
for i in range(M_center-2-TB_2.shape[0],M_center-2):
for j in range(M_center+int(TSource.shape[0]/2)-1,TB_2.shape[1]+M_center+int(TSource.shape[0]/2)-1):
paint_matrix[i][j]=5
TB_3 = matrix(branch_W,int(lenght_active_si_transistor))
for i in range(M_center-TB_3.shape[1]-int(TSource.shape[0]/2),M_center-int(TSource.shape[0]/2)):
for j in range(M_center-2-TB_3.shape[0],M_center-2):
paint_matrix[i][j]=5
TB_4 = matrix(branch_W,int(lenght_active_si_transistor))
for i in range(M_center+int(TSource.shape[0]/2)-1,TB_4.shape[1]+M_center+int(TSource.shape[0]/2)-1):
for j in range(M_center+3,TB_4.shape[0]+M_center+3):
paint_matrix[i][j]=5
opcion2()
plt.matshow(paint_matrix)
plt.show()
Calculo del valor promedio de KP para cada transistor
In [16]:
def prom_KP_n_for_transistor(transistor_num,common_source):
"Return a prom value of KP_n for a single transistor in the wafer"
Kpn_sum=0
Kpn_found=0
for i in range(0,int(math.sqrt(paint_matrix.size))):
for j in range(0,int(math.sqrt(paint_matrix.size))):
if paint_matrix[i][j] == transistor_num:
Kpn_sum += Kp_n[i][j]
Kpn_found += 1
if paint_matrix[i][j] == common_source:
Kpn_sum += Kp_n[i][j]
Kpn_found += 1
Kpn_prom=Kpn_sum/(Kpn_found)
return Kpn_prom
def prom_KP_p_for_transistor(transistor_num,common_source):
"Return a prom value of KP_p for a single transistor in the wafer"
Kpp_sum=0
Kpp_found=0
for i in range(0,int(math.sqrt(paint_matrix.size))):
for j in range(0,int(math.sqrt(paint_matrix.size))):
if paint_matrix[i][j] == transistor_num:
Kpp_sum += Kp_p[i][j]
Kpp_found += 1
if paint_matrix[i][j] == common_source:
Kpp_sum += Kp_p[i][j]
Kpp_found += 1
Kpp_prom=Kpp_sum/(Kpp_found)
return Kpp_prom
Con variacion de variacion a partir de la esquina de Kp en la oblea
In [17]:
print("Para la opcion de diseno 1: Transistores ahorro de espacio con centroide: \n")
paint_matrix = matrix(int(size_m),int(size_m))
opcion1()
corner_kp_n()
plt.matshow(Kp_n)
plt.show()
plt.matshow(paint_matrix)
plt.show()
Kpn_T1=prom_KP_n_for_transistor(1,common_source)
Kpn_T2=prom_KP_n_for_transistor(2,common_source)
Kpn_T3=prom_KP_n_for_transistor(3,common_source)
Kpn_T4=prom_KP_n_for_transistor(4,common_source)
print("Kp_n Transistor 1: "+str(Kpn_T1))
print("Kp_n Transistor 2: "+str(Kpn_T2))
print("Kp_n Transistor 3: "+str(Kpn_T3))
print("Kp_n Transistor 4: "+str(Kpn_T4))
corner_kp_p()
Kpp_T1=prom_KP_p_for_transistor(1,common_source)
Kpp_T2=prom_KP_p_for_transistor(2,common_source)
Kpp_T3=prom_KP_p_for_transistor(3,common_source)
Kpp_T4=prom_KP_p_for_transistor(4,common_source)
print("Kp_p Transistor 1: "+str(Kpp_T1))
print("Kp_p Transistor 2: "+str(Kpp_T2))
print("Kp_p Transistor 3: "+str(Kpp_T3))
print("Kp_p Transistor 4: "+str(Kpp_T4))
print("Para la opcion de diseno 2: Transistores con source comun en centroide: \n")
paint_matrix = matrix(int(size_m),int(size_m))
opcion2()
corner_kp_n()
plt.matshow(Kp_n)
plt.show()
plt.matshow(paint_matrix)
plt.show()
Kpn_T1=prom_KP_n_for_transistor(4,common_source)
Kpn_T2=prom_KP_n_for_transistor(5,common_source)
print("Kp_n Transistor 1: "+str(Kpn_T1))
print("Kp_n Transistor 2: "+str(Kpn_T2))
corner_kp_p()
Kpp_T1=prom_KP_p_for_transistor(4,common_source)
Kpp_T2=prom_KP_p_for_transistor(5,common_source)
print("Kp_p Transistor 1: "+str(Kpp_T1))
print("Kp_p Transistor 2: "+str(Kpp_T2))
Con variacion del centro hacia afuera de Kp en la oblea
In [18]:
print("Para la opcion de diseno 1: Transistores ahorro de espacio con centroide: \n")
paint_matrix = matrix(int(size_m),int(size_m))
opcion1()
center_kp_n()
plt.matshow(Kp_n)
plt.show()
plt.matshow(paint_matrix)
plt.show()
Kpn_T1=prom_KP_n_for_transistor(1,common_source)
Kpn_T2=prom_KP_n_for_transistor(2,common_source)
Kpn_T3=prom_KP_n_for_transistor(3,common_source)
Kpn_T4=prom_KP_n_for_transistor(4,common_source)
print("Kp_n Transistor 1: "+str(Kpn_T1))
print("Kp_n Transistor 2: "+str(Kpn_T2))
print("Kp_n Transistor 3: "+str(Kpn_T3))
print("Kp_n Transistor 4: "+str(Kpn_T4))
center_kp_p()
Kpp_T1=prom_KP_p_for_transistor(1,common_source)
Kpp_T2=prom_KP_p_for_transistor(2,common_source)
Kpp_T3=prom_KP_p_for_transistor(3,common_source)
Kpp_T4=prom_KP_p_for_transistor(4,common_source)
print("Kp_p Transistor 1: "+str(Kpp_T1))
print("Kp_p Transistor 2: "+str(Kpp_T2))
print("Kp_p Transistor 3: "+str(Kpp_T3))
print("Kp_p Transistor 4: "+str(Kpp_T4))
print("Para la opcion de diseno 2: Transistores con source comun en centroide: \n")
paint_matrix = matrix(int(size_m),int(size_m))
opcion2()
center_kp_n()
plt.matshow(Kp_n)
plt.show()
plt.matshow(paint_matrix)
plt.show()
Kpn_T1=prom_KP_n_for_transistor(4,common_source)
Kpn_T2=prom_KP_n_for_transistor(5,common_source)
print("Kp_n Transistor 1: "+str(Kpn_T1))
print("Kp_n Transistor 2: "+str(Kpn_T2))
center_kp_p()
Kpp_T1=prom_KP_p_for_transistor(4,common_source)
Kpp_T2=prom_KP_p_for_transistor(5,common_source)
print("Kp_p Transistor 1: "+str(Kpp_T1))
print("Kp_p Transistor 2: "+str(Kpp_T2))
Circuitos a simular:
In [19]:
display(Image(url='images/espejo_n.png'))
print("Espejo NMOS")
In [20]:
display(Image(url='images/espejo_p.png'))
print("Espejo PMOS")
Funcion para editar los archivo de simulacion del espejo NMOS 'espejoNmosPythonFile.cir' y el espejo P 'espejoPmosPythonFile.cir'
In [21]:
import sys
import fileinput
def modificar_cir_Espejo_NMOS(W,L,Kp_T1,Kp_T2):
text="* Simulación Circuito Espejo de Corriente con Ncmos, valores reales de Kp_n y Vt"+"\n"+ \
"* Universidad Nacional de Colombia 2016"+"\n"+ \
"* CMOS Analógico"+"\n"+ \
"* Grupo Jorge Garzón, Esteban Iafrancesco A"+"\n"+ \
"\n"+\
"VDD VDD 0 DC 10 AC 0"+"\n"+\
"V2 VR 0 DC 10 AC 0"+"\n"+\
"VRD RDN VR DC 0 AC 0"+"\n"+\
"RD RDN DRAIN 1000"+"\n"+\
"RP VDD GATE 2000"+"\n"+\
"M1 DRAIN GATE 0 0 nmosideal W="+str(W)+" L="+str(L)+"\n"+\
"M2 GATE GATE 0 0 nmosideal W="+str(W)+" L="+str(L)+"\n"+\
"\n"+\
"VRD2 RDN2 VR DC 0 AC 0"+"\n"+\
"RD2 RDN2 DRAIN2 1000"+"\n"+\
"RP2 VDD GATE2 2000"+"\n"+\
"M3 DRAIN2 GATE2 0 0 nmos1 W="+str(W)+" L="+str(L)+"\n"+\
"M4 GATE2 GATE2 0 0 nmos2 W="+str(W)+" L="+str(L)+"\n"+\
"\n"+\
".model nmosideal nmos LEVEL=1 Vto=0.8 KP=120u LAMBDA=0.01 U0=650"+"\n"+\
".model nmos1 nmos LEVEL=1 Vto=0.8 KP="+str(Kp_T1)+" LAMBDA=0.01 U0=650"+"\n"+\
".model nmos2 nmos LEVEL=1 Vto=0.8 KP="+str(Kp_T2)+" LAMBDA=0.01 U0=650"+"\n"+\
"\n"+\
".control"+"\n"+\
"set color0 =white"+"\n"+\
"set color1=black"+"\n"+\
"op"+"\n"+\
"show all"+"\n"+\
"dc vdd 0.7 12 0.01"+"\n"+\
"plot i(vrd) i(vrd2)"+"\n"+\
".endc"+"\n"
for i, line in enumerate(fileinput.input('../spice-simulations/espejoNmosPythonFile.cir', inplace=1)):
if i == 1: sys.stdout.write(text) # replace 'sit' and write
fileinput.close()
def modificar_cir_Espejo_PMOS(W,L,Kp_T1,Kp_T2):
text="* Simulación Circuito Espejo de Corriente con Ncmos, valores reales de Kp_n y Vt"+"\n"+ \
"* Universidad Nacional de Colombia 2016"+"\n"+ \
"* CMOS Analógico"+"\n"+ \
"* Grupo Jorge Garzón, Esteban Iafrancesco A"+"\n"+ \
"\n"+\
"VDD VDD 0 DC -10 AC 0"+"\n"+\
"V2 VR 0 DC -10 AC 0"+"\n"+\
"VRD RDN VR DC 0 AC 0"+"\n"+\
"RD RDN DRAIN 1000"+"\n"+\
"RP VDD GATE 2000"+"\n"+\
"M1 DRAIN GATE 0 0 pmosideal W="+str(W)+" L="+str(L)+"\n"+\
"M2 GATE GATE 0 0 pmosideal W="+str(W)+" L="+str(L)+"\n"+\
"\n"+\
"VRD2 RDN2 VR DC 0 AC 0"+"\n"+\
"RD2 RDN2 DRAIN2 1000"+"\n"+\
"RP2 VDD GATE2 2000"+"\n"+\
"M3 DRAIN2 GATE2 0 0 pmos1 W="+str(W)+" L="+str(L)+"\n"+\
"M4 GATE2 GATE2 0 0 pmos2 W="+str(W)+" L="+str(L)+"\n"+\
"\n"+\
".model pmosideal pmos LEVEL=1 Vto=-0.9 KP=40u LAMBDA=0.0125 U0=250"+"\n"+\
".model pmos1 pmos LEVEL=1 Vto=-0.9 KP="+str(Kp_T1)+" LAMBDA=0.0125 U0=250"+"\n"+\
".model pmos2 pmos LEVEL=1 Vto=-0.9 KP="+str(Kp_T2)+" LAMBDA=0.0125 U0=250"+"\n"+\
"\n"+\
".control"+"\n"+\
"set color0 =white"+"\n"+\
"set color1=black"+"\n"+\
"op"+"\n"+\
"show all"+"\n"+\
"dc vdd -0.8 -12 -0.01"+"\n"+\
"plot i(vrd) i(vrd2)"+"\n"+\
".endc"+"\n"
for i, line in enumerate(fileinput.input('../spice-simulations/espejoPmosPythonFile.cir', inplace=1)):
if i == 1: sys.stdout.write(text) # replace 'sit' and write
fileinput.close()
Simulacion con variacion desde la esquina de Kp_n en la oblea y diseno 1 de ahorro de espacio, centroide comun entre 2 transistores (de los 4 disponibles) para formar el espejo de corriente.
In [22]:
paint_matrix = matrix(int(size_m),int(size_m))
opcion1()
corner_kp_n()
plt.matshow(Kp_n)
plt.show()
plt.matshow(paint_matrix)
plt.show()
Kpn_T1=prom_KP_n_for_transistor(1,common_source)
Kpn_T2=prom_KP_n_for_transistor(2,common_source)
Kpn_T3=prom_KP_n_for_transistor(3,common_source)
Kpn_T4=prom_KP_n_for_transistor(4,common_source)
#modificar_cir_Espejo_NMOS(WTA,L,Kpn_T1,Kpn_T2)
In [23]:
display(Image(url='images/corner_TA_TB.png'))
print("VDD vs -Iout. Rojo Espejo ideal, Azul Espejo Con variaciones en KP_n de la oblea. Transistores TA y TB")
In [24]:
#modificar_cir_Espejo_NMOS(WTA,L,Kpn_T1,Kpn_T3)
In [25]:
display(Image(url='images/corner_TA_TC.png'))
print("VDD vs -Iout. Rojo Espejo ideal, Azul Espejo Con variaciones en KP_n de la oblea. Transistores TA y TC")
In [26]:
#modificar_cir_Espejo_NMOS(WTA,L,Kpn_T2,Kpn_T3)
In [27]:
display(Image(url='images/corner_TB_TC.png'))
print("VDD vs -Iout. Rojo Espejo ideal, Azul Espejo Con variaciones en KP_n de la oblea. Transistores TB y TC")
Simulacion con variacion desde el centro de Kp_n en la oblea y centroide comun entre 2 transistores (de los 4 disponibles) para formar el espejo de corriente.
In [28]:
paint_matrix = matrix(int(size_m),int(size_m))
opcion1()
center_kp_n()
plt.matshow(Kp_n)
plt.show()
plt.matshow(paint_matrix)
plt.show()
Kpn_T1=prom_KP_n_for_transistor(1,common_source)
Kpn_T2=prom_KP_n_for_transistor(2,common_source)
Kpn_T3=prom_KP_n_for_transistor(3,common_source)
Kpn_T4=prom_KP_n_for_transistor(4,common_source)
#modificar_cir_Espejo_NMOS(WTA,L,Kpn_T1,Kpn_T2)
In [29]:
display(Image(url='images/cetroid_Kp_TA_TB_n.png'))
print("VDD vs -Iout. Rojo Espejo ideal, Azul Espejo Con variaciones en KP_n de la oblea. Transistores TA y TB")
In [30]:
#modificar_cir_Espejo_NMOS(WTA,L,Kpn_T2,Kpn_T3)
In [31]:
display(Image(url='images/cetroid_Kp_TB_TC_n.png'))
print("VDD vs -Iout. Rojo Espejo ideal, Azul Espejo Con variaciones en KP_n de la oblea. Transistores TB y TC")
Simulacion con variacion desde la esquina de Kp_n en la oblea y diseno 2 de surce compartido, centroide comun entre 2 transistores para formar el espejo de corriente.
In [32]:
paint_matrix = matrix(int(size_m),int(size_m))
opcion2()
corner_kp_n()
plt.matshow(Kp_n)
plt.show()
plt.matshow(paint_matrix)
plt.show()
Kpn_T1=prom_KP_n_for_transistor(4,common_source)
Kpn_T2=prom_KP_n_for_transistor(5,common_source)
#modificar_cir_Espejo_NMOS(WTA,L,Kpn_T1,Kpn_T2)
In [33]:
display(Image(url='images/corner_Kp_CS_n.png'))
print("VDD vs -Iout. Rojo Espejo ideal, Azul Espejo Con variaciones en KP_n de la oblea. Diseno de source compartido")
Simulacion con variacion desde el centro de Kp_n en la oblea y diseno 2 de surce compartido, centroide comun entre 2 transistores para formar el espejo de corriente.
In [34]:
paint_matrix = matrix(int(size_m),int(size_m))
opcion2()
center_kp_n()
plt.matshow(Kp_n)
plt.show()
plt.matshow(paint_matrix)
plt.show()
Kpn_T1=prom_KP_n_for_transistor(4,common_source)
Kpn_T2=prom_KP_n_for_transistor(5,common_source)
#modificar_cir_Espejo_NMOS(WTA,L,Kpn_T1,Kpn_T2)
In [35]:
display(Image(url='images/center_Kp_CS_n.png'))
print("VDD vs -Iout. Rojo Espejo ideal, Azul Espejo Con variaciones en KP_n de la oblea. Diseno de source compartido")
Simulacion con variacion desde la esquina de Kp_p en la oblea y centroide comun entre 2 transistores (de los 4 disponibles) para formar el espejo de corriente.
In [36]:
paint_matrix = matrix(int(size_m),int(size_m))
opcion1()
corner_kp_p()
plt.matshow(Kp_p)
plt.show()
plt.matshow(paint_matrix)
plt.show()
Kpp_T1=prom_KP_p_for_transistor(1,common_source)
Kpp_T2=prom_KP_p_for_transistor(2,common_source)
Kpp_T3=prom_KP_p_for_transistor(3,common_source)
Kpp_T4=prom_KP_p_for_transistor(4,common_source)
#modificar_cir_Espejo_PMOS(WTA,L,Kpp_T1,Kpp_T2)
In [37]:
display(Image(url='images/corner_TA_TB_p.png'))
print("VDD vs -Iout. Rojo Espejo ideal PMOS, Azul Espejo Con variaciones en KP_p de la oblea. Transistores TA y TB")
In [38]:
#modificar_cir_Espejo_PMOS(WTA,L,Kpp_T1,Kpp_T3)
In [39]:
display(Image(url='images/corner_TA_TC_p.png'))
print("VDD vs -Iout. Rojo Espejo ideal PMOS, Azul Espejo Con variaciones en KP_p de la oblea. Transistores TA y TC")
In [40]:
#modificar_cir_Espejo_PMOS(WTA,L,Kpp_T2,Kpp_T3)
In [41]:
display(Image(url='images/corner_TB_TC_p.png'))
print("VDD vs -Iout. Rojo Espejo ideal PMOS, Azul Espejo Con variaciones en KP_p de la oblea. Transistores TB y TC")
Simulacion con variacion desde el centro de Kp_p en la oblea y centroide comun entre 2 transistores (de los 4 disponibles) para formar el espejo de corriente.
In [42]:
paint_matrix = matrix(int(size_m),int(size_m))
opcion1()
center_kp_p()
plt.matshow(Kp_p)
plt.show()
plt.matshow(paint_matrix)
plt.show()
Kpp_T1=prom_KP_p_for_transistor(1,common_source)
Kpp_T2=prom_KP_p_for_transistor(2,common_source)
Kpp_T3=prom_KP_p_for_transistor(3,common_source)
Kpp_T4=prom_KP_p_for_transistor(4,common_source)
#modificar_cir_Espejo_PMOS(WTA,L,Kpp_T1,Kpp_T2)
In [43]:
display(Image(url='images/center_Kp_LS_p.png'))
print("VDD vs -Iout. Rojo Espejo ideal, Azul Espejo Con variaciones en KP_p de la oblea. Transistores TA y TB")
In [44]:
#modificar_cir_Espejo_PMOS(WTA,L,Kpp_T2,Kpp_T3)
In [45]:
display(Image(url='images/center_Kp_LS_p_RB_RC.png'))
print("VDD vs -Iout. Rojo Espejo ideal, Azul Espejo Con variaciones en KP_p de la oblea. Transistores TB y TC")
Simulacion con variacion desde la esquina de Kp_p en la oblea y diseno 2 de surce compartido, centroide comun entre 2 transistores para formar el espejo de corriente.
In [46]:
paint_matrix = matrix(int(size_m),int(size_m))
opcion2()
corner_kp_p()
plt.matshow(Kp_p)
plt.show()
plt.matshow(paint_matrix)
plt.show()
Kpp_T1=prom_KP_p_for_transistor(4,common_source)
Kpp_T2=prom_KP_p_for_transistor(5,common_source)
#modificar_cir_Espejo_PMOS(WTA,L,Kpp_T1,Kpp_T2)
In [47]:
display(Image(url='images/center_Kp_CS_p.png'))
print("VDD vs -Iout. Rojo Espejo ideal, Azul Espejo Con variaciones en KP_p de la oblea. Diseno de source compartido")
Simulacion con variacion desde el centro de Kp_p en la oblea y diseno 2 de surce compartido, centroide comun entre 2 transistores para formar el espejo de corriente.
In [48]:
paint_matrix = matrix(int(size_m),int(size_m))
opcion2()
center_kp_p()
plt.matshow(Kp_p)
plt.show()
plt.matshow(paint_matrix)
plt.show()
Kpp_T1=prom_KP_p_for_transistor(4,common_source)
Kpp_T2=prom_KP_p_for_transistor(5,common_source)
#modificar_cir_Espejo_PMOS(WTA,L,Kpp_T1,Kpp_T2)
In [49]:
display(Image(url='images/center_Kp_CS_p_btr.png'))
print("VDD vs -Iout. Rojo Espejo ideal, Azul Espejo Con variaciones en KP_p de la oblea. Diseno de source compartido")
[1] Los transistores tipo PNP son mas suceptibles a las variaciones de la transconductancia Kp_p sobre la oblea que los transistores NPN, debido que los valores tipicos son mas bajos en los primeros.
[2] La configuracion de diseno 1 de ahorro de espacio en el CI y centroide comun en el centro de la oblea para los transistores tiene buen matching de dos transistores solo cuando el Kp varia del centro hacia afuera de la oblea.
[3] La configuracion de diseno 2 de source compartido y centroide comun en el centro de la oblea tiene las mejores caracteristicas de matchig entre 2 transistores, tanto para variaciones desde la esquina de la oblea como para las variaciones desde el centro.
[4]Asumiendo variaciones desde el centro de la oblea, y diseno 2 de source compartido, el matchig es el mejor y la desviacion con el valor ideal de KP tambien, lo cual resulta en que el espejo NPN y el PNP se comporten muy parecido a los espejos ideales.
[5] Los espejos de corriente simulados con transistores PNP presentaron una mayor desviacion del comportamiento ideal del espejo de corriente por lo mencionado en el numeral [1].